Object-Relational Mapping (“ORM”) is a programming technique that allows developers to write source code using object-oriented programming languages instead of Structured Query Language (“SQL”) to access data maintained in a relational database. Developers can use their preferred object-oriented programming language to work with a database instead of hard-coding SQL statements or other types of stored procedures. For example, and without imputing limitation, an ORM code written in the Java® programming language may be used to retrieve from a database information related to a particular entry with an identification number of “0001” and with the ORM code written as:
DBValue thisEntry=database.GetEntryID(“0001”);
In contrast, a hard-coded SQL statement achieving the same outcome may be considerably more verbose and be constructed with a different semantic model. The hard-coded SQL query may also be more difficult to use with variable lookups (for example, where an input to the source code is used to generate a database query such as in a web platform receiving user queries or where a dictionary of entries is updated frequently and recompiling source code for every update would be impractical). The SQL query may be written and transmitted to the database using the JDBC Java® API to connect to the target database as below:
String sql=“SELECT . . . FROM entries WHERE id=0001”;
Connection conn=null;
Statement stmt=conn.createStatementQ;
DBValue thisEntry=stmt.executeQuery(sql);
Often, ORM is used during rapid development of software written using an object-oriented programming language. Using ORM can speed up development by not having to switch between writing in the object-oriented programming language and writing declarative SQL statements when attempting to access a database—doing so is often time consuming and labor intensive. Moreover, using ORM allows developers to switch between different databases with minimal modifications being made to the object-oriented source code.
As a software project becomes more complex and the speed of development becomes less important, the continued use of ORM may present challenges. For example, overuse of ORM in a software project may reduce performance of the resultant program since the ORM translates application code into a corresponding SQL statement. Moreover, once a software project is released into a production environment, rarely is a database changed. So the continued use of ORM to abstract away database dependencies provides minimal value. Thus, while an ORM tool is a useful tool for rapidly bringing a software project into production, its continued use in real production environments offers diminishing returns. However, manual removal of ORM is often a tedious and error-prone process that slows down bringing a software project into production and/or introduces new bugs due to inconsistent ORM removal or human error.
It is with these problems in mind, among others, that various aspects of the present disclosure were conceived.